Blitz (142/213)

From:David McMinn
Date:25 May 2000 at 10:44:02
Subject:Re: Adding GTString gadgets

Hi Tony

> I need to add a number of GT Gadgets to an existing gadget list, have
> them displayed on the window and not lose the data displayed in the
> existing gadgets.

OK. As you and James have already mentioned, DetachGTList will lose the
contents of the gadgets. Or maybe its just Free GTList x that makes it lose the
contents.

Anyway, you might be able to just do a DetachGTList, add the new gadgets in and
then AttachGTList. I'm not sure how you'd go about freeing the extra gadgets by
themselves, you'd probably need to free the whole lot.

It would probably work something like this:

; Pseudocodese
extralist.w=0 ; tells what set of extra gadgets to create
; set it to 0 for only initial gadgets

Function cigl{}
Create initial gadget list
End Function

Function extra1{}
create one set of extra gadgets
End Function

Function extra2{}
create another set of extra gadgets
End Function

Function extra3{}
create final set of extra gadgets
End Function

cigl{}
select extralist
case 1:extra1{}
case 2:extra2{}
case 3:extra3{}
end select

create window
attachgtlist

; main loop
while not(quit)
waitevent
if event=gadgetup and gadgethit=string gadget
parse contents
set extralist to appropriate value
take copy of contents of all gadgets
detachgtlist
freegtlist
cigl{}
select extralist
case 1:extra1{}
case 2:extra2{}
case 3:extra3{}
end select
restore all gadget contents
attachgtlist
end if
wend

for processing the events from the extra gadget lists you have two options

1) give each gadget a unique ID number

2) reuse gadget IDs, but when processing them, use a select extralist...end
select and process the appropriate gagdet events within that for each gagdte
list.



|) /\ \/ ][ |) |\/| c |\/| ][ |\| |\| | dave@satanicdreams.com
http://members.xoom.com/David_McMinn | ICQ=16827694
Never argue with an idiot. They drag you down to their
level then beat you with experience.

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie